﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
 	<!-- 包含公共的JSP代码片段 -->
	
<title>无线点餐平台</title>

<base href="<%=basePath%>">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="${pageContext.request.contextPath}/sys/style/js/jquery.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/sys/style/js/page_common.js"></script>

<link href="${pageContext.request.contextPath}/sys/style/css/common_style_blue.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/sys/style/css/index_1.css" />

</head>
<body>
<!-- 页面标题 -->
<div id="TitleArea">
	<div id="TitleArea_Head"></div>
	<div id="TitleArea_Title">
		<div id="TitleArea_Title_Content">
			<img border="0" width="13" height="13" src="style/images/title_arrow.gif"/> VIP列表
		</div>
    </div>
	<div id="TitleArea_End"></div>
</div>


<!-- 过滤条件 -->
<div id="QueryArea">
	<form action="${pageContext.request.contextPath}/VipAction!query.action" method="post">
		<select name="sele">
		  <!-- -->
		  <option value="v_name">用户名</option>
	      <option value="v_number">账号</option>
		  <option value="v_type">类型</option>
		</select>
		<input type="text" name="shuru" value=""><!-- 把要模糊查询文字传给action -->
		<input type="submit" value="搜索">
	</form>
</div>


<!-- 主内容区域（数据列表或表单显示） -->
<div id="MainArea">
<!-- 这种方式是从jsp页面点击这个链接跳转到action的 -->
<!--<a href="${pageContext.request.contextPath}/search.action">请求跳转到action的name为search</a> -->
    <table class="MainArea_Content" cellspacing="0" cellpadding="0">
        <!-- 表头-->
        <thead>
            <tr align="center" valign="middle" id="TableTitle">
				<td>编号</td>
				<td>用户名</td>
				<td>类型</td>
				<td>性别</td>
				<td>账号</td>
			</tr>
		</thead>	
		<!--显示数据列表 -->
        <tbody id="TableData">
        
            <!-- 用迭代器在list链表里获取动态数据 ，value指取出action里面的变量为list(不可变)，var与下面的value配对，需要加#号-->
			<s:iterator value="list" var="vip" >
			   <tr>                <!-- 用ognl表达式获取数据库动态数据并显示在页面 -->
				<td align="center"><s:property value="#vip.v_id"/></td>
				<td align="center"><s:property value="#vip.v_name"/></td>
				<td align="center"><s:property value="#vip.v_type"/></td>
				<td align="center"><s:property value="#vip.v_sex"/></td>
				<td align="center"><s:property value="#vip.v_number"/></td>
				<td align="center" with="6%">
					<a href="${pageContext.request.contextPath}/VipAction!updata_show.action?v_id=<s:property value="#vip.v_id"/>&v_name=<s:property value="#vip.v_name"/>&v_type=<s:property value="#vip.v_type"/>&v_sex=<s:property value="#vip.v_sex"/>&v_number=<s:property value="#vip.v_number"/>" class="FunctionButton">更新</a>				
					<a href="${pageContext.request.contextPath}/VipAction!delete.action?id=<s:property value="#vip.v_id"/>" onClick="return delConfirm();" class="FunctionButton">删除</a>				
					<!-- 页面跳转action的方法 -->	                                     <!-- 动态获取要删除桌号的id。 -->
					<!-- 项目名+action所在的package的namespace（在自己的xml文件里找的）+ -->
					<!-- action的name+.action-->														
				</td>
				
				</tr>
			</s:iterator>
			
			
        
			
        </tbody>
    </table>
	
   <!-- 其他功能超链接 -->
	<div id="TableTail" align="center">
		<div class="FunctionButton"><a href="${pageContext.request.contextPath}/sys/vipadd.jsp">添加</a></div>
    </div> 
</div>
</body>
</html>
